package com.thunder.rebot.rebotclient.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.thunder.rebot.rebotclient.R;
import com.thunder.rebot.rebotclient.iml.OnTvClickListener;

public class CustomListviewPopwindow extends PopupWindow {




    private ListView listview;

//    private OnTvClickListener onTvClickListener;
//    public void setTvOnclickListener(OnTvClickListener onclickListener){
//        this.onTvClickListener = onclickListener;
//    }

    public ListView getListview() {
        return listview;
    }

    public void setListview(ListView listview) {
        this.listview = listview;
    }

    public CustomListviewPopwindow(Context context, int res) {
        super(context);
        setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
        setOutsideTouchable(true);
        setFocusable(true);
        setBackgroundDrawable(context.getResources().getDrawable(R.mipmap.popwindow_bg));
        View contentView = LayoutInflater.from(context).inflate(res, null, false);
        listview = contentView.findViewById(R.id.listview);
//        listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//            @Override
//            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//
//            }
//        });
        setContentView(contentView);
    }






}
